#!/bin/bash

echo `(seq 33)` >redballs.txt
redball=(`seq -w 33`)
blueball=(`seq -w 16`)

echo -n -e "\e[1;35m Welcome to buy the double chromosphere,please input number to purchase(6 red balls and 1 blue balls):\e[0m";read input_num

for i in `(seq 6)`
do
        rest_red=($(cat redballs.txt))
        number=`echo $((RANDOM%(33-i)))`
        echo "${rest_red[$number]}" >>redrest.txt
        unset rest_red[$number]
        echo ${rest_red[@]} >redballs.txt
done

red_ball=($(cat redrest.txt))
echo -e "\e[32m your lucky number is:\e[0m \e[31m red balls:`echo ${red_ball[@]}`\e[0m :\e[34m blue ball:`echo $((RANDOM%16+1))`\e[0m" 
>redrest.txt 

